package cn.goktech.sports.modules.importDataone.dao;

import cn.goktech.sports.modules.importDataone.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.omg.CORBA.OBJ_ADAPTER;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper {
    //根据名称查询用户
    UserEntity selectUserByName(@Param("name") String name);

    //根据账号密码查询用户
    UserEntity selectUserByNameAndPwd(@Param("name") String name, @Param("password") String password);

    //添加
    boolean insertUserEntity(@Param("entity") UserEntity user);

    //修改
    boolean updatetUserEntity(@Param("entity") UserEntity user);

    //查询地区列表
    List<OriginalPlaceEntity> getAreaList();

    //查询国家列表
    List<BaseCountry> getCountryList();

    //查询仓库列表
    List<Depot> getDepotList(@Param("countryId") Long countryId);

    //国际直达查询
    List<NationalWeightEntity> getNationAreaList(@Param("national_area_name")String national_area_name);

    //查询头程仓库
    List<HeadProcessEntity> getHeadProcess(@Param("name")String name);

    //头程计费
    List<ChargingSectionEntity> getChargingSectionList(@Param("header_id")Long header_id);

    //查询燃油费
    Map<String,Object> getFuel(@Param("fuel_id")Long fuel_id);

    //查询附头程空运加费
    List<Map<String,Object>> getAttachCost(@Param("header_id")Long header_id);

    //查询头程海运
    List<HeaderSeaEntity> getHeaderSea(@Param("name")String name);

    //查询海运区间价格
    List<ShippingCharging> getHeaderSeaCharging(@Param("sea_id")Long sea_id);

    //查询头程铁运
    List<HeaderRailwayEntity> getHeaderRailway(@Param("name")String name);

    //查询铁运区间
    List<HeaderRailwaySectionEntity> getHeaderRailwaySection(@Param("railway_id")Long railway_id);

    //获取陆运头程数据
    List<HeadWayEntity> getHeaderLandWay(@Param("name")String name,@Param("weight") int weight);

    //获取是否为头程违禁品。
    Integer getGoodsNameNum(@Param("goodsName") String goodsName,@Param("depotId") Long depotId);

    //获取是否为国际EMS违禁品。
    List<Map<String,String>> getProhibitedNum(@Param("goodsName") String goodsName,@Param("countryId") Long countryId);
    //查询DHL和FedEx的大于某个值后的计费规则
    List<Map<String,Object>> getThroughSection(@Param("country_partition_id")Long country_partition_id,@Param("product_type_id")Long product_type_id);

    //查询DHL不大于某个值得计费规则
    List<Map<String,Object>> getDhlCharging(@Param("country_partition_id")Long country_partition_id,@Param("product_type_id")Long product_type_id);
    //查询FedEx不大于某个值得计费规则
    Map<String,Object> getFedExCharging(@Param("partition_id")Long partition_id,@Param("product_type_id")Long product_type_id,@Param("weight")BigDecimal weight);
}
